Mingw#2
Open
bscottm wants to merge 98 commits intojwinarske:cmakefrom
Open
Conversation
Add MinGW GNU compiler support. Also update CMake minimum version, since some of the newer generator features are used.
If CMAKE_INSTALL_PREFIX defaults (not set) on initial run, nail the
prefix to ${CMAKE_SOURCE_DIR}/PTHREADS-BUILT. And make sure it persists
across subsequent runs.
Also found a minor cleanup when setting target compile flags.
Fix GCC warning about "char *" used with immutable strings. It's also a bad idea to cast a pointer to int. Use ptrdiff_t instead.
Use PRIVATE for all target defines, libraries, options, etc. PUBLIC ends up adding extra flags to library dependents because it alters the INTERFACE and PRIVATE target properties at the same time. So, if libpthreadGC3 gets build with __PTW32_BUILD and that definition is added to the libpthreadGC3 target (target_compile_definitions) with PUBLIC, the test cases inherit the __PTW32_BUILD define. It's almost worse than using add_compile_definitions. Punchline: Localize target flags, definitions, options and libraries using PRIVATE. Note: 100% of the tests pass for GNU x64. Some fail for x86. This can be attributed to the difference in C++ exception handling. x64 uses SEH, x86 uses SJLJ.
- Generate config.h in ${CMAKE_BINARY_DIR} instead of overwriting
config.h in the top-level source directory. Arrange the include
directory list to ensure it gets picked up before the top-level.
- Fat finger? Install tests for VC from the appropriate configuration
subdirectory.
08c3881 to
d0530d2
Compare
…mingw Also, workaround the new CMake source enforcement "feature", where CMake actually embeds the source type on the MSVC command line (i.e., "/TC" for C source, "/TP" for C++ source.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renamed "gnu_compiler" branch to "mingw" (works better when using CMake's ExternalPackage_Add)